// https : // iai.sh.cn/problem/13
#include <bits/stdc++.h>
using namespace std;
int a[1000001];
const int M = 10000;
typedef long long LL;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  LL fengzi = 1;
  for (int i = 1; i <= n; i++) {
    fengzi = (fengzi % M * a[i] % M) % M;
  }
  for (int i = 1; i <= n; i++) {
    cout << fengzi / a[i] % M << endl;
  }

  return 0;
}
